package com.rede.didiok.common.exception.exceptionType;

import java.io.Serializable;

import com.rede.didiok.common.constant.global.ErrorCode;
import com.rede.didiok.common.constant.conf.base.BaseMessageConf;

/**
 * 自定义 Feign 调用操作相关的异常
 *
 */
public class FeignException extends RuntimeException implements Serializable {

    /**
     * 异常状态码
     */
    private String code;

    public FeignException() {
        super(BaseMessageConf.FEIGN_DEFAULT_ERROR);
        this.code = ErrorCode.FEIGN_DEFAULT_ERROR;
    }

    public FeignException(String message, Throwable cause) {
        super(message, cause);
        this.code = ErrorCode.FEIGN_DEFAULT_ERROR;
    }

    public FeignException(String message) {
        super(message);
        this.code = ErrorCode.FEIGN_DEFAULT_ERROR;
    }

    public FeignException(String code, String message) {
        super(message);
        this.code = code;
    }

    public FeignException(Throwable cause) {
        super(cause);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
